S3 Event-Driven Invocation of Lambda
Amazon S3 can trigger a Lambda function automatically in response to specific events like object uploads, deletions, or updates. This allows developers to build serverless, event-driven architectures where file operations directly invoke backend logic without manual polling.
s3:ObjectCreated:* – triggers when an object is uploaded or copied
s3:ObjectRemoved:* – triggers when an object is deleted
s3:ObjectRestore:* – triggers when an archived object is restored
s3:Replication:* – triggers when an object is replicated
Go to the S3 bucket in the AWS Console
Select the 'Properties' tab and find 'Event notifications'
Create a new event and specify the event type (e.g., ObjectCreated)
Choose 'Lambda function' as the destination
Select the Lambda function and grant it permission to be invoked by S3